import java.util.*;

public class Main2 {
    public static void main(String[] args)
    {
        Scanner cin = new Scanner(System.in);
        int n = cin.nextInt();
        int cnt = 0;

        int arr[] = new int[n];

        for(int i =0;i<n;i++)
        {
            arr[i] = cin.nextInt();
        }
        int get = cin.nextInt()+30;

        for(int i =0;i<n;i++)
        {
            if(get>=arr[i])
                cnt++;
        }

        System.out.print(cnt);

        cin.close();
    }
}
